package com.smartalarmclock.Model.Exceptions;

@SuppressWarnings("serial")
public class ReferenceCannotBeNullException extends Exception {
	
	/**
	 * Constructor
	 * @param referencingType the type of the referencing data entity
	 * @param referencingId the id of the referencing data entity
	 * @param referencedType the type of the referenced data entity
	 */
	public ReferenceCannotBeNullException(Class<?> referencingType, int referencingId, Class<?> referencedType) {
		super(String.format("Cannot set reference of type %s to null (in type %s with id %d)",
			referencedType.getSimpleName(),
			referencingType.getSimpleName(),
			referencingId));
	}
}
